3. When a lookup runs
A registration is looked up from stock, from a non-stock booking, and from a new enquiry.
The first three are switched on the lease company. Each one has a Haynes Pro switch and a Stubbed Service switch. Haynes Pro on means the lookup runs. Stubbed Service on means a saved sample is used instead of the live call. With Haynes Pro off, the lookup finishes as DISABLED and Haynes Pro is not called.
| Lease company setting | Used when |
|---|---|
| VRM Lookup for new vehicles import | A stock record is created, its registration changes, or vehicles are imported. This can raise a large number of lookups. ![]() |
| VRM Lookup for non-stock vehicles | The customer does not own the stock, for example a glass provider, and an enquiry is created for that vehicle. The lookup fills in make, model, VIN and the other vehicle details. ![]() |
| VRM Lookup for new enquiry | A new enquiry is created. The lookup runs in the background and is saved on the customer contract. ![]() |
3.1 Stock create and VRM change
Creating a stock record, or changing the registration on one, does not call Haynes Pro immediately. The lookup is placed on the queue, and the queue runs it. A stock import is queued the same way.
The request needs the registration, the lease company and the stock record. It is stored at:
/ancillary/VRMLookups/vrmLookupOnStockUpsert/{docId}
{
vrm,
leaseCompanyId,
stockId,
timestamp,
useStub,
status: "REQUEST",
type: "VRM_LOOKUP_FOR_STOCK"
}
useStub is the Stubbed Service switch on VRM Lookup for new vehicles import. A request with no registration or no lease company is ignored, as is anything that is no longer REQUEST.
When the lookup returns a vehicle, the VISN vehicle type is chosen before the result is saved. See Vehicle type.
The result is written back onto that request and onto the stock record:
leasecompany/{leaseCompanyId}/stock/{stockId}
{
vrmLookup: {
vin,
make,
model,
registrationDate,
vehicleCategoryDescription,
vehicleType,
fuelType,
colour,
vrm,
maintained: "Y",
source: "VRM_LOOKUP",
timestamp,
lookUpProvider,
isValid
},
vrmLookedUp: true
}
lookUpProvider is STUB when the stub was used, otherwise HAYNES_PRO. isValid is false when the response is empty. A failure still schedules a retry. See 3.5 Retry.
3.2 Book-in
Book-in records a lookup request for the lease company and the registration:
/ancillary/VRMLookups/haynesPro/{docId}
{
vrm,
leaseCompanyId,
timestamp,
status: "REQUEST"
}
If the registration is already on stock, the lookup stays tied to that stock record. If it is not, the request id is used as the new stock id.
VRM Lookup for non-stock vehicles decides whether the lookup runs and whether Stubbed Service is used. When the lookup returns a vehicle, the VISN vehicle type is chosen before the result is saved. See Vehicle type. The result is merged onto the same request. Stock is not updated yet.
When the book-in enquiry is created, a non-empty result is copied onto the stock record. Make, model, VIN, fuel, colour and registration date are written on the stock record and inside vrmLookup. The Haynes category is stored as vehicleTypeFromLookup. lookUpProvider is HAYNES_PRO and maintained is Y. An empty result is left off the stock record.
3.3 New enquiry
Creating an enquiry looks the registration up again, including when the stock record was looked up before. A walk-in does not use this path.
This uses VRM Lookup for new enquiry on the lease company. When the lookup returns a vehicle, the VISN vehicle type is chosen before the result is saved. See Vehicle type.
A RESPONSE is written to stock and copied onto the lease enquiry and the supplier enquiry, under the vehicle:
{
vrmLookedUp: true,
vrmLookup: { ... }
}
The Haynes category is stored as vehicleTypeFromLookup, and lookUpProvider is HAYNES_PRO.
DISABLED leaves the stock record unchanged. ERROR still writes an empty vrmLookup with isValid: false, sets vrmLookedUp to true, and schedules a retry.
3.4 Walk-in
A walk-in looks the registration up while the enquiry is saved, and only when it already has a stock record. It uses VRM Lookup for new enquiry. If vrmLookedUp is already true, the stored result is kept and Haynes Pro is not called. When the lookup returns a vehicle, the VISN vehicle type is chosen before the result is saved. See Vehicle type. A RESPONSE or an ERROR is written onto the stock record. lookUpProvider is HAYNES_PRO.
3.5 Retry
A failed stock lookup, and a failed new-enquiry lookup, are tried again.
vrmRetryAttempton the stock record is increased by one.- The next attempt is 7 days later, and it is raised as a new stock lookup request.
- After 3 attempts, no further retry is scheduled.
- In lower environments the retry stops once the attempt count is above 1.
incidents@digitalinnk.comandjitendra@digitalinnk.comare emailed when the limit is reached. The subject is "VRM Lookup Failed After Maximum Attempts".
A retry uses the Stubbed Service switch of the lookup it is repeating. It is not scheduled when that lease company setting is missing or switched off.
Status: Accepted
Category: Protected
Authored By: Rama Krishna on Nov 16, 2026


